import 'package:flutter/material.dart';

class PagingWidget extends StatefulWidget {
  const PagingWidget({Key? key}) : super(key: key);

  @override
  State<PagingWidget> createState() => _PagingWidgetState();
}

class _PagingWidgetState extends State<PagingWidget>
    with SingleTickerProviderStateMixin {
  List tabs = ['Tab1', 'Tab2', 'Tab3', 'Tab4', 'Tab5'];
  late TabController tabController;
  @override
  void initState() {
    super.initState();
    tabController = TabController(length: tabs.length, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('ListView分页加载'),
        ),
        body: Column(
          children: [
            Container(
              width: MediaQuery.of(context).size.width,
              height: 50,
              color: Colors.blue,
              child: TabBar(
                controller: tabController,
                tabs: tabs.map((e) => Text(e)).toList(),
              ),
            ),
          ],
        ));
  }
}
